#include<bits/stdc++.h>
using namespace std;
int n,m;
char s[100011],t[100011];
int f[2011][2011],g[2011][2011];
int lt[100011];
int st[100011],top;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin >> s;n = strlen(s);
	for(int i = n;i;i--)
		s[i] = s[i - 1];
	cin >> t;m = strlen(t);
	for(int i = m;i;i--)
		t[i] = t[i - 1];
	s[0] = t[0] = 0;
	for(int i = 1;i <= n;i++)
	{
		if(s[i] == s[i - 1])
			lt[i] = lt[i - 1];
		else
			lt[i] = i;
	}
	f[0][0] = g[0][0] = 1;
	for(int i = 1;i <= n;i++) if(lt[i] == 1)
		f[i][0] = 1;
	for(int i = 1;i <= n;i++)
	{
		for(int k = 1;k <= m;k++)
			if(s[i] == t[k] && g[i - 1][k - 1] > g[max(lt[i - 1] - 2,0)][k - 1])
				f[i][k] = 1;
		for(int k = 0;k <= m;k++)
			g[i][k] = g[i - 1][k] + f[i][k];
	}
	if(g[n][m] - g[max(lt[n] - 2,0)][m])
	{
		cout << "YES\n";
		for(int i = n,j = m;i;i--) if(j)
			if(f[i][j])
				st[++top] = i,j--;
		while(top)
			cout << st[top--] << ' ';
	}else{
		cout << "NO\n";
	}
	return 0;
}
